/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package se392.ateam2006.meetingmgmt;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Calendar;
import se392.ateam2006.meetingmgmt.meeting.MeetingEntity;
import se392.ateam2006.resourcemgmt.room.RoomEntity;
import se392.ateam2006.utils.Debug;

/**
 *
 * @author rob
 */
public class MeetingCandidate implements Serializable {
    private int activeScore;
    private int passiveScore;
    private boolean validity;
    private Calendar start;
    private Calendar end;
    private Calendar endDate;
    private MeetingEntity meeting;
    private int blocksize;
    private RoomEntity room = null;
    private ArrayList<RoomEntity> possibleRooms;
    
    public MeetingCandidate(MeetingEntity m){
        this.validity = true;
        this.activeScore = 0;
        this.passiveScore = 0;
        this.meeting = m;
        possibleRooms = null;
    }

    public int getActiveScore() {
        return activeScore;
    }

    public void addActiveScore(int score) {
        this.activeScore+=score;
    }
    
    public int getPassiveScore(){
        return passiveScore;
    }
    
    public void addPassiveScore(int score){
        this.passiveScore+=score;
    }

    public Calendar getStart() {
        return start;
    }

    public void setStart(Calendar start) {
        this.start = start;
    }
    
    public void setStart(Calendar start, int blocksize){
        this.start = start;
        this.blocksize = blocksize;
        this.activeScore = 0;
        this.passiveScore = 0;
        this.end = (Calendar)this.start.clone();        
        this.end.add(Calendar.MINUTE, blocksize);        
    }

    public Calendar getEnd() {
        return end;
    }

    public void setEnd(Calendar end) {
        this.end = end;
    }

    public MeetingEntity getMeeting() {
        return meeting;
    }

    public void setMeeting(MeetingEntity meeting) {
        this.meeting = meeting;
    }

    public boolean getValidity() {
        return validity;
    }

    public void setValidity(boolean validity) {
        this.validity = validity;
    }

    public RoomEntity getRoom() {
        return room;
    }

    public void setRoom(RoomEntity room) {
        this.room = room;
    }

    /**
     * @deprecated
     */
    public Calendar getEndDate() {
        Debug.print(6, "MC : getEndDate : DEPRECATED please use getEnd");
        return end;
    }

    /**
     * @deprecated
     */
    public void setEndDate(Calendar endDate) {
        Debug.print(6, "MC : setEndDate : DEPRECATED please use setEnd");
        //this.endDate = endDate;
        this.end = endDate;
    }
    
    public String toString(){
        String spam = "" + getStart() + " : " + getEnd() + " :: Validity " + getValidity() ;
        return spam;
    }

    public ArrayList<RoomEntity> getPossibleRooms() {
        return possibleRooms;
    }

    public void setPossibleRooms(ArrayList<RoomEntity> possibleRooms) {
        this.possibleRooms = possibleRooms;
    }
}
